package javaBase.nowcoder.HJ62_B_查找输入整数二进制中1的个数;

import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
        while ((str = br.readLine()) != null) {
            int n = Integer.parseInt(str);
            String s = Integer.toBinaryString(n);
            int cnt = 0;
            for (char c : s.toCharArray())
                if (c == '1')
                    cnt++;
            System.out.println(cnt);
        }
    }
}
